
import type { AreaDropListData, PoleListData, PoleListParams, PoleParams, WarningDetailData, WarningListData, WarningListParams } from "@/types/pole";
import { request } from "@/utils/reuqest";

// 查看一体杆列表
export const getPoleListAPI = (params: PoleListParams) =>{
  return request<PoleListData>('/pole/info/list','GET', params)
}

// 关联区域下拉列表

export const getAreaDropListAPI = () =>{
  return request<AreaDropListData[]>('/parking/area/dropList','GET')
}

// 添加一体杆
export const createPoleAPI = (data: PoleParams) =>{
  return request('/pole/info','POST', data)
}

// 删除一体杆
export const delPoleAPI = (ids: number[]) =>{
  return request(`/pole/info/${ids.join(',')}`,'DELETE')
}

// 修改一体杆
export const updatePoleAPI = (data: PoleParams) =>{
  return request('/pole/info','PUT', data)
}

// 告警记录列表
export const getWarningListAPI = (params: WarningListParams) =>{
  return request<WarningListData>('/pole/warning/list','GET', params)
}

// 告警记录详情
export const getWarningDetailAPI = (id: number) =>{
  return request<WarningDetailData>(`/pole/warning/${id}`,'GET')
}